Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle duplicated Vert.x context in CaffeineCacheImpl #41647

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

gwenneg
Copy link
Member

@gwenneg gwenneg commented Jul 2, 2024

@gwenneg
Copy link
Member Author

gwenneg commented Jul 2, 2024

I was able to reproduce locally the issues from #39515 and #41081 with the reproducers provided by the Quarkus users. Then, I confirmed that this PR fixes both issues.

The Vert.x context is untested in quarkus-cache though. I'm trying to determine if that can be tested somehow.

@gwenneg gwenneg marked this pull request as ready for review July 3, 2024 08:29
@gwenneg
Copy link
Member Author

gwenneg commented Jul 3, 2024

@geoand I'm out of time for today but I'll try to add the test later with a separate PR. Until then, I think this PR can be merged. WDYT?

@geoand
Copy link
Contributor

geoand commented Jul 3, 2024

Yeah, I agree.

Let's also get a +1 from @cescoffier

@geoand geoand requested a review from cescoffier July 3, 2024 08:33

This comment has been minimized.

@geoand
Copy link
Contributor

geoand commented Jul 3, 2024

Hm... I'm wondering if this change would affect Infinispan and Redis cache implementations...

@gwenneg
Copy link
Member Author

gwenneg commented Jul 3, 2024

The Infinispan impl depends on a separate CacheResultInterceptor and does not depend on CaffeineCacheImpl so I think we're safe here. I'm still checking why the test failed...

I'm not sure about the Redis impl.

@geoand
Copy link
Contributor

geoand commented Jul 3, 2024

The Infinispan impl depends on a separate CacheResultInterceptor and does not depend on CaffeineCacheImpl so I think we're safe here. I'm still checking why the test failed...

I think this is only the case for io.quarkus.infinispan.client.CacheResult - cc @karesti

I'm not sure about the Redis impl.

cc @cescoffier

@gwenneg
Copy link
Member Author

gwenneg commented Jul 3, 2024

The test from quarkus-infinispan-cache that failed depends on the annotation and interceptor from quarkus-cache while a variation of both the annotation and the interceptor exist in quarkus-infinispan-client. I'm a bit confused about how things are organized in the Infinispan impl today. I've been away from too long 😅

@karesti
Copy link
Member

karesti commented Jul 3, 2024

The test from quarkus-infinispan-cache that failed depends on the annotation and interceptor from quarkus-cache while a variation of both the annotation and the interceptor exist in quarkus-infinispan-client. I'm a bit confused about how things are organized in the Infinispan impl today. I've been away from too long 😅

Custom annotations are deprecated in the infinispan client extension, they were introduced before the SPI existed. The infinispan cache extension is now fully providing the replacement of caffeine by infinispan with the new extension

@karesti
Copy link
Member

karesti commented Jul 3, 2024

@geoand @gwenneg @cescoffier I don't know if we need any fix on the deprecated annotations, since the new extension provides the fix . what do you think ?

@karesti
Copy link
Member

karesti commented Jul 3, 2024

The test from quarkus-infinispan-cache that failed depends on the annotation and interceptor from quarkus-cache while a variation of both the annotation and the interceptor exist in quarkus-infinispan-client. I'm a bit confused about how things are organized in the Infinispan impl today. I've been away from too long 😅

https://quarkus.io/guides/cache-infinispan-reference
https://www.youtube.com/watch?v=y1YR57_p2Yo

@geoand
Copy link
Contributor

geoand commented Jul 3, 2024

I don't think the old annotations need a fix, but we do need to make sure that @gwenneg's fix doesn't break Infinispan with the regular cache annotations (my guess is that it might, as I don't see the context juggling that was moved to Caffeine)

@cescoffier
Copy link
Member

It needs a proper tests but I think the Redis cache is going to propagate the requester duplicated context, and the callback from Redis is going to preserve the duplicated context.

@karesti
Copy link
Member

karesti commented Jul 3, 2024

@geoand how should I be testing this to make sure, beyond the already existing tests

@geoand
Copy link
Contributor

geoand commented Jul 3, 2024

Take a look at the issues this PR closes.
You would likely be able to reproduce the same problems with the infinispan cache backend.
My assumption is that this PR will not make things any better for Infinispan, if anything it should make it worse

@karesti
Copy link
Member

karesti commented Jul 3, 2024

@geoand do you think I should move the change to the cache impl ? I can have a closer look tomorrow

@geoand
Copy link
Contributor

geoand commented Jul 4, 2024

I think the infinispan cache implementation will need a similar change to this one

@karesti
Copy link
Member

karesti commented Jul 4, 2024

@gwenneg I opened a PR here https://github.com/gwenneg/quarkus/pull/298/files

@geoand
Copy link
Contributor

geoand commented Jul 5, 2024

@gwenneg could you please merge (without a merge commit) Katia's PR into your branch so this PR can be updated?

Thanks

@gwenneg
Copy link
Member Author

gwenneg commented Jul 5, 2024

Sure, done!

@geoand
Copy link
Contributor

geoand commented Jul 5, 2024

Thanks a lot!

@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jul 5, 2024
Copy link

quarkus-bot bot commented Jul 5, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit dca2139.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@geoand geoand merged commit 2e007d2 into quarkusio:main Jul 5, 2024
25 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.13 - main milestone Jul 5, 2024
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jul 5, 2024
@gsmet gsmet modified the milestones: 3.13 - main, 3.12.2 Jul 9, 2024
@rsvoboda
Copy link
Member

Hi @gwenneg. Did you have chance to look adding the test later with a separate PR as noted in #41647 (comment)?

@gwenneg gwenneg deleted the 41081 branch July 17, 2024 13:34
@gwenneg
Copy link
Member Author

gwenneg commented Jul 17, 2024

Hey @rsvoboda. No, not yet. I'm currently on PTO so that will have to wait a bit.

@gsmet gsmet modified the milestones: 3.12.2, 3.8.6 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants